package Bonus;

import model.ProgBob;

import com.golden.gamedev.object.PlayField;
import com.golden.gamedev.object.Sprite;
import com.golden.gamedev.object.SpriteGroup;

public abstract class AbstractBonus extends Sprite // is it necessary to use Sprite group?
{
        private String myName;
        private Sprite myIcon;
        private PlayField myPlayField;
    private AbstractBonus myNext;
    private double myBonusNum;
    private Sprite myBonus;

    public AbstractBonus (PlayField playField, String name, Sprite icon)
    //public AbstractBonus(String name, Sprite sprite)
    {
        //super("Bonus"); // Should be handled by resources
        this.myPlayField = playField;
        this.myName = name;
        this.myBonus = icon;
        this.myNext = null;
        this.myBonusNum = 0;
        //this.myBonus = icon;
        //this.add(myBonus); // Add Sprite to this SpriteGroup
        this.setActive(false);
    }
    
    @Override
    public void update(long elapsedTime)
    {
        act();
        //super.update(elapsedTime); //?
    }
    
    public String getName()
    {
        return myName;
    }
    
    public Sprite getIcon()
    // TODO: change method name
    {
        return myIcon;
    }
    
    public void setNext(AbstractBonus next)
    {
        myNext = next;
    }
    
    public AbstractBonus getNext()
    {
        return myNext;
    }
    
    public ProgBob getProgBob()
    {
        return (ProgBob) myPlayField;
    }
    
    public void setBonus(double num)
    {
        myBonusNum = num;
    }

    // A method that changes state-control variable in ProgBob
    public abstract void act ();
}